# !/usr/bin/env python
# -- coding: utf-8 --
# @Author zengxiaohui
# Datatime:5/26/2021 4:10 PM
# @File:delete_no
import glob
import os


if __name__ == '__main__':
    img_dir = '/home/zengxh/medias/data/ext/creepageDistance/20210714/smallimg/tb/org'
    # img_dir = '/home/lmin/data/BigCut/images/yiwu'
    paths = glob.glob(os.path.join(img_dir, '*.jpg'))
    for imgPath in paths:
        jsonpath = imgPath.replace(".jpg",".json")
        if not ("_0_t." in imgPath or "_0_b." in imgPath or "_3_t." in imgPath or "_3_b." in imgPath):
            os.remove(imgPath)
            os.remove(jsonpath)